import { ref } from 'vue';
import { getEditDetailApi } from '@/api/sj/productManagement/integratedProduction';

const useWorkOrderDetail = () => {

    const editDialogVisible = ref(false);
    const editObj = ref<any>();

    /** 打开 编辑 弹窗 */
    const handlOpenEditDetails = async (row: any) => {
        const { code, data } = await getEditDetailApi(row.childrenOrderId);
        if (code == 200) {
            editObj.value = data
            editDialogVisible.value = true;
        }
    };

    /** 关闭定稿弹窗 */
    const handlOpenEditDetailsClose = () => {
        editDialogVisible.value = false;
    };

    return {
        editDialogVisible,
        editObj,
        handlOpenEditDetails,
        handlOpenEditDetailsClose
    }
};

export default useWorkOrderDetail;
